mod express_eval;
mod luhn;
use express_eval::{eval, Expression, Operation, Res};
fn main() {
    println!("Hello, world!");
    let cc_number = "4223 9826 4026 9299"; //"1234 5678 1234 5670";
    println!(
        "Is {cc_number} a valid credit card number? {}",
        if luhn::luhn(cc_number) { "yes" } else { "no" }
    );

    assert_eq!(
        eval(Expression::Op {
            op: Operation::Div,
            left: Box::new(Expression::Value(99)),
            right: Box::new(Expression::Value(0)),
        }),
        Err(String::from("division by zero"))
    );
}
